<template>
  <div class="home-container">
    <el-card class="welcome-card">
      <template #header>
        <div class="card-header">
          <h1>欢迎来到 AllHome</h1>
          <p>现代化的跨平台应用解决方案</p>
        </div>
      </template>

      <div class="content">
        <div class="feature-grid">
          <el-card class="feature-card" shadow="hover">
            <el-icon size="48" color="#409EFF"><Monitor /></el-icon>
            <h3>跨平台支持</h3>
            <p>支持桌面端和移动端，一套代码多端运行</p>
          </el-card>

          <el-card class="feature-card" shadow="hover">
            <el-icon size="48" color="#67C23A"><Iphone /></el-icon>
            <h3>响应式设计</h3>
            <p>完美适配各种屏幕尺寸，提供一致的用户体验</p>
          </el-card>

          <el-card class="feature-card" shadow="hover">
            <el-icon size="48" color="#E6A23C"><Lock /></el-icon>
            <h3>安全可靠</h3>
            <p>基于 Tauri 架构，提供更高的安全性</p>
          </el-card>

          <el-card class="feature-card" shadow="hover">
            <el-icon size="48" color="#F56C6C"><Lightning /></el-icon>
            <h3>高性能</h3>
            <p>轻量级架构，快速启动，流畅运行</p>
          </el-card>
        </div>

        <div class="action-buttons">
          <el-button type="primary" size="large" @click="$router.push('/login')">
            开始使用
          </el-button>
          <el-button size="large" @click="$router.push('/register')">
            立即注册
          </el-button>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script setup lang="ts">
import { Monitor, Iphone, Lock, Lightning } from '@element-plus/icons-vue'
</script>

<style scoped>
.home-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.welcome-card {
  width: 100%;
  max-width: 1200px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card-header {
  text-align: center;
  margin-bottom: 40px;
}

.card-header h1 {
  margin: 0 0 12px 0;
  color: #333;
  font-size: 36px;
  font-weight: 700;
}

.card-header p {
  margin: 0;
  color: #666;
  font-size: 18px;
}

.content {
  padding: 20px 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.feature-card {
  text-align: center;
  padding: 32px 24px;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
}

.feature-card h3 {
  margin: 16px 0 12px 0;
  color: #333;
  font-size: 20px;
  font-weight: 600;
}

.feature-card p {
  margin: 0;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .card-header h1 {
    font-size: 28px;
  }
  
  .card-header p {
    font-size: 16px;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .feature-card {
    padding: 24px 16px;
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .action-buttons .el-button {
    width: 200px;
  }
}

@media (max-width: 480px) {
  .welcome-card {
    margin: 0 10px;
  }
  
  .card-header h1 {
    font-size: 24px;
  }
  
  .card-header p {
    font-size: 14px;
  }
  
  .content {
    padding: 10px 0;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .welcome-card {
    background: #1a1a1a;
    border-color: #333;
  }
  
  .card-header h1 {
    color: #fff;
  }
  
  .card-header p {
    color: #999;
  }
  
  .feature-card {
    background: #2a2a2a;
    border-color: #333;
  }
  
  .feature-card h3 {
    color: #fff;
  }
  
  .feature-card p {
    color: #999;
  }
}
</style>
